<!-- 用户账号 -->
<template>
  <div>这里是用户账号功能</div>
</template>
<script>
export default {
  data() {
    return {
      menuName: "",
        menuKey: "",
        dataId:0,
        orgId:0,
        password: "",
        newPassword: "",
        checkPassword: ""
    };
  },
  props:{
    menuData:{
      type:Object,
      required:true
    },
    theOrg:{
      type:Number,
      required:true
    }
  },
  created() {
    
  },
  mounted() {
    
  },
  methods: {
    testLogin(){
      this.$router.push("/index");
    },
    // 修改密码对话框【确认】点击事件
    submitPass() {
      this.$refs.editFormRef.validate(valid => {
        if (!valid) return;
        this.$confirm("是否确认修改密码？", "温馨提示", {
          confirmButtonText: "确认",
          cancelButtonText: "取消",
          type: "warning"
        }).then(async () => {
          if (this.editPassword.checkPassword == this.editPassword.newPassword) {
            const { data: res } = await this.$http.get(
              "/api/changePwd",{
                params: {
                  oldPwd: this.editPassword.password,
                  newPwd: this.editPassword.checkPassword
                }
              }
            );
            if (res.result) {
              this.$refs.editFormRef.resetFields(); //重置
              this.$message({
                message: res.msg,
                type: "success"
              });
            } else {
              this.$message({
                message: res.msg,
                type: "error"
              });
            }
          } else {
            this.$message({
              message: "新密码不一致",
              type: "error"
            });
          }
        });
      });
    }
  }
};
</script>
<style scoped>

</style>
